# 测试问候语功能
import sys
sys.stdout.reconfigure(encoding='utf-8')

from question_classifier import QuestionClassifier
from answer_generator import AnswerGenerator

print("=== 测试问候语功能 ===")

# 测试问题分类
qc = QuestionClassifier()
test_questions = ["你好", "Hello", "Hi", "什么是所有权？"]

print("\n1. 问题分类测试:")
for question in test_questions:
    result = qc._rule_based_classify(question)
    print(f"'{question}' -> {result['label']} (置信度: {result['confidence']})")

# 测试问候语回复
print("\n2. 问候语回复测试:")
ag = AnswerGenerator()
greeting_response = ag._generate_greeting_response("你好")
print(f"回复长度: {len(greeting_response)}")
print(f"包含Rust: {'Rust' in greeting_response}")

print("\n=== 测试完成 ===")


